//--------------------------------------------------------------
//
// Qizhi Zhang 
// ezhung@gmail.com
// http://www.moorwind.com
//
//--------------------------------------------------------------
package reader.controller
{
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	
	import reader.ApplicationFacade;
	import reader.core.ReaderModelLocator;
	import reader.core.WindowManager;
	import reader.view.SettingPanelMediator;
	import reader.view.components.SettingPanel;

	public class SettingPanelCommand extends SimpleCommand implements ICommand
	{
		//////////////////////////////////////////////////////////////////////////////
		//methods
		override public function execute(notification:INotification):void
		{
			if(!WindowManager.isWindowRegisted(ReaderModelLocator.WINDOW_SETTING_PANEL))
			{
				var window:SettingPanel = new SettingPanel();
				window.windowType = ReaderModelLocator.WINDOW_SETTING_PANEL;
				WindowManager.registerWindow(window);
				facade.registerMediator(new SettingPanelMediator(window));
				facade.registerCommand(ApplicationFacade.REMOVE_LABEL, RemoveLabelCommand);
				facade.registerCommand(ApplicationFacade.OPML_EXECUTE, OPMLCommand);
				window.open();
			}
		}
		
	}
}